package com.b2c.product.controller.admin;

import com.b2c.product.pojo.dto.BranchDto;
import com.b2c.product.service.BranchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import result.Result;

@RestController("adminBranchController")
@RequestMapping("/admin/branch")
public class BranchController {
    @Autowired
    BranchService branchService;

    /**
     * 获取商户的品牌
     * @return
     */
    @GetMapping
    public Result getBranchByAdminId(){
        return branchService.getBranchByAdminId();
    }
    /**
     * 添加品牌
     */
    @PostMapping
    public Result insertBranch(BranchDto branchDto){
        return branchService.insert(branchDto);
    }
    /**
     * 删除品牌
     */
    @DeleteMapping
    public Result deleteBranch(){
        return branchService.delete();
    }

}
